package com.example.demo.controller;

import com.example.demo.api.HelloService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SayHelloController {

    //@DubboReference(version = "1.0.0", url = "dubbo://192.168.31.66:20880")
    //@DubboReference(version = "1.0.0", protocol = "dubbo", check = false)
    @DubboReference
    HelloService helloService;

    @GetMapping("/hello")
    public ResponseEntity hello() {
        String a = helloService.sayHello("chenye");
        return ResponseEntity.ok(a);
    }

    @GetMapping("/test")
    public ResponseEntity test() {
        return ResponseEntity.ok("test");
    }
}